package zuo;

import java.util.Scanner;

public class zuo03 {


    public static void main(String[] args) {
        He();//调用方法
    }
    public static void He(){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数");
        int n = sc.nextInt();
        int sum=0; //设和值
        int avg=0;
        for (int i = 1; i <=n; i++) {

            sum=i+sum;//用循环把每个数加起来
        }
          avg=sum/n;
        System.out.println(sum);
        System.out.println("平均数"+avg);
    }





       }
